home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 April
/
EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso
/
EARCD
/
comm
/
fido
/
OBManager.lha
/
OBManager
/
ARexx
/
db
/
Config
next >
Wrap
Text File
|
1996-11-09
|
906b
|
37 lines
/*
* Config
*
* USAGE:
* INTERPRET "CALL 'db/Config'('SAVE',cfg_file,template,"template")"
* INTERPRET 'db/Config'('LOAD',cfg_file,cfg_default)
*
* REQUIREMENTS:
* REXX:dos/ReadBlock
* REXX:dos/WriteBlock
*
* Config is a module that let you store and retrive little configuration
* files for an ARexx script...
*
* $(C): (1996, Rocco Coluccelli, Bologna)
* $VER: Config 0.14 (09.Nov.1996)
*/
OPTIONS RESULTS
PARSE UPPER VALUE ARG(1) WITH act +1
IF act = "S" THEN DO
v = '00'x; w = "||'00'x||"; cfg = ""; args = ARG(3); argv = ARG(4)
DO UNTIL args = ""
PARSE VAR args arg (w) args; PARSE VAR argv val (v) argv
IF DATATYPE(val,'N') THEN cfg = cfg || arg"="val || '0a'x; ELSE cfg = cfg || arg"='"C2X(val)"'x" || '0a'x
END; RETURN 'dos/WriteBlock'(ARG(2),cfg)
END
ELSE IF act = "L" THEN DO
CALL 'dos/ReadBlock'(ARG(2))
IF result = "" THEN RETURN ARG(3)
RETURN result
END
RETURN 0